function validateCheckbox(cName,minCheck)
{
  var oHobbies = document.getElementsByName(cName);
  var numOfCheckBox = oHobbies.length;
  var count = 0;
  for(var i=0 ; i < numOfCheckBox ; i++){
    if(oHobbies[i].checked == true ) {
      count++;
    }
  }
  if(count < minCheck) {
    //alert("Please select at least "+minCheck+" hobbies");
    return false;
  }
  return true;
}

function validate()
{  
	var oName = document.register.name;
	var oEmail = document.register.email;
	var ohiddenGender = document.register.
  hiddenGender;
  
	if(oName.value == '') {
		alert("Please enter Name");
    oName.focus();
		return false;

	} else 
	if(oName.value.length < 6) {
		alert("Please enter atleast 6 character");
		oName.focus();
    oName.select();
    return false;
	}else if(ohiddenGender.value == ""){
    alert("Please select any gender");
    return false;
  } else if(validateCheckbox('hobbies[]',3)== false) {
    alert("Please select at least 3 hobbies");
    return false;
  }
	return true;

}